#include <ctime>
#include <iostream>
#include <fstream>

using namespace std;

void bubblesort(int list[], int listlenght) {
        while(listLenght--)
                bool swapped = false;

                for(int i = 0; i <listLengh; i++) {
                        if(list[i] > list[i + 1]){
                                swap(list[i], list[i + 1]);
                                swapped =true;
                        }
                }

                if(swapped == false) break;i
        }
}

void read_from_file(const char *filename, int a[], int length) {
    ifstream file(filename);

    for(int i = 0; i <listLengh; i++)
        file >> a[i];
}

int  main()
{
    #defline LEN 5000
    int a[LEN];

    read_form_file("m1_sorted.txt",a,LEN);
    usingned int t_start =  clock();
    bubblesort(a,LEN);
    usingned int t_finish = clock();
    usingned int t_work = t_finish - t-start;
    count<<"m1_sorted " << t_work << "milliseconds \n";

    read_form_file("m2_reverse.txt",a,LEN);
    t_start = clock();
    bubblesort(a,LEN);
    t_finish = clock();
    t_wort = t_finish - t_start;
    count<<"m2_reverse" <<t_work <<"milliseconds \n";

    read_form_file("m3_shuffle.txt",a,LEN);
    t_start = clock();
    bubblesort(a,LEN);
    t_finish = clock();
    t_wort = t_finish - t_start;
    count<<"m3_shuffle" <<t_work <<"milliseconds \n";
